From 8f049f2ce1ad23e50100c4dd3071e747d45edd61 Mon Sep 17 00:00:00 2001 From: "kaf24@scramble.cl.cam.ac.uk" Date: Mon, 7 Feb 2005 19:45:56 +0000 Subject: [PATCH] bitkeeper revision 1.1159.212.115 (4207c574hv18R_VTm-3a9w_AZzNBWw) Force hypercall continuation arguments to size of longs. Signed-off-by: keir.fraser@cl.cam.ac.uk --- xen/arch/x86/domain.c | 2 +- xen/arch/x86/memory.c | 4 ++-- xen/arch/x86/traps.c | 4 ++-- xen/common/dom_mem_ops.c | 4 ++-- xen/common/multicall.c | 4 ++-- xen/include/xen/sched.h | 26 +++++++++++++++++++++++++- 6 files changed, 34 insertions(+), 10 deletions(-) diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index fa441175cd..150b6e921b 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -628,7 +628,7 @@ long do_iopl(domid_t domain, unsigned int new_io_pl) return 0; } -unsigned long hypercall_create_continuation( +unsigned long __hypercall_create_continuation( unsigned int op, unsigned int nr_args, ...) { struct mc_state *mcs = &mc_state[smp_processor_id()]; diff --git a/xen/arch/x86/memory.c b/xen/arch/x86/memory.c index c532700e3c..6575f160c7 100644 --- a/xen/arch/x86/memory.c +++ b/xen/arch/x86/memory.c @@ -1378,8 +1378,8 @@ int do_mmu_update( { if ( hypercall_preempt_check() ) { - rc = hypercall_create_continuation( - __HYPERVISOR_mmu_update, 3, ureqs, + rc = hypercall3_create_continuation( + __HYPERVISOR_mmu_update, ureqs, (count - i) | (FOREIGNDOM->id << MMU_UPDATE_PREEMPT_FDOM_SHIFT) | MMU_UPDATE_PREEMPTED, pdone); diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 18f4948608..4cf22f86d7 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -791,8 +791,8 @@ long do_set_trap_table(trap_info_t *traps) if ( hypercall_preempt_check() ) { UNLOCK_BIGLOCK(current->domain); - return hypercall_create_continuation( - __HYPERVISOR_set_trap_table, 1, traps); + return hypercall1_create_continuation( + __HYPERVISOR_set_trap_table, traps); } if ( copy_from_user(&cur, traps, sizeof(cur)) ) return -EFAULT; diff --git a/xen/common/dom_mem_ops.c b/xen/common/dom_mem_ops.c index 9de62004ba..d5c272e301 100644 --- a/xen/common/dom_mem_ops.c +++ b/xen/common/dom_mem_ops.c @@ -25,8 +25,8 @@ #define PREEMPT_CHECK(_op) \ if ( hypercall_preempt_check() ) \ - return hypercall_create_continuation( \ - __HYPERVISOR_dom_mem_op, 5, \ + return hypercall5_create_continuation( \ + __HYPERVISOR_dom_mem_op, \ (_op) | (i << START_EXTENT_SHIFT), \ extent_list, nr_extents, extent_order, \ (d == current->domain) ? DOMID_SELF : d->id); diff --git a/xen/common/multicall.c b/xen/common/multicall.c index 112a9f3176..1eb3a8cd51 100644 --- a/xen/common/multicall.c +++ b/xen/common/multicall.c @@ -67,8 +67,8 @@ long do_multicall(multicall_entry_t *call_list, unsigned int nr_calls) if ( i < nr_calls ) { mcs->flags = 0; - return hypercall_create_continuation( - __HYPERVISOR_multicall, 2, &call_list[i], nr_calls-i); + return hypercall2_create_continuation( + __HYPERVISOR_multicall, &call_list[i], nr_calls-i); } } } diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index 4381799d89..75af955c82 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -262,8 +262,32 @@ int idle_cpu(int cpu); /* Is CPU 'cpu' idle right now? */ void startup_cpu_idle_loop(void); -unsigned long hypercall_create_continuation( +unsigned long __hypercall_create_continuation( unsigned int op, unsigned int nr_args, ...); +#define hypercall0_create_continuation(_op) \ + __hypercall_create_continuation((_op), 0) +#define hypercall1_create_continuation(_op, _a1) \ + __hypercall_create_continuation((_op), 1, \ + (unsigned long)(_a1)) +#define hypercall2_create_continuation(_op, _a1, _a2) \ + __hypercall_create_continuation((_op), 2, \ + (unsigned long)(_a1), (unsigned long)(_a2)) +#define hypercall3_create_continuation(_op, _a1, _a2, _a3) \ + __hypercall_create_continuation((_op), 3, \ + (unsigned long)(_a1), (unsigned long)(_a2), (unsigned long)(_a3)) +#define hypercall4_create_continuation(_op, _a1, _a2, _a3, _a4) \ + __hypercall_create_continuation((_op), 4, \ + (unsigned long)(_a1), (unsigned long)(_a2), (unsigned long)(_a3), \ + (unsigned long)(_a4)) +#define hypercall5_create_continuation(_op, _a1, _a2, _a3, _a4, _a5) \ + __hypercall_create_continuation((_op), 5, \ + (unsigned long)(_a1), (unsigned long)(_a2), (unsigned long)(_a3), \ + (unsigned long)(_a4), (unsigned long)(_a5)) +#define hypercall6_create_continuation(_op, _a1, _a2, _a3, _a4, _a5, _a6) \ + __hypercall_create_continuation((_op), 6, \ + (unsigned long)(_a1), (unsigned long)(_a2), (unsigned long)(_a3), \ + (unsigned long)(_a4), (unsigned long)(_a5), (unsigned long)(_a6)) + #define hypercall_preempt_check() \ (unlikely(softirq_pending(smp_processor_id()))) -- 2.30.2